package com.xique.door.bean.transfer;


import com.xique.door.bean.domain.AccessDevice;
import com.xique.door.bean.request.AccessDevice.AccessDeviceAddRequest;
import com.xique.door.bean.request.AccessDevice.AccessDeviceEditRequest;

/**
 * @author shd
 * @create 2021/7/6 9:43
 */
public class AccessDeviceTransfer {

    /**
     * 添加请求转换为domain
     * @author shd
     * @date 2021/7/6 13:46
     * @param request
     * @return com.jzy.oms.access.device.bean.domain.AccessDevice
     */
    public static AccessDevice transferAccessDevice(AccessDeviceAddRequest request) {

        AccessDevice accessDevice = new AccessDevice();
        accessDevice.setParkId(request.getParkId());
        accessDevice.setName(request.getName());
        accessDevice.setModel(request.getModel());
        accessDevice.setAddress(request.getAddress());
        accessDevice.setAccessType(request.getAccessType());
        accessDevice.setIsNetwork(request.getIsNetwork());
        accessDevice.setDevSn(request.getDevSn());
        accessDevice.setStatus(request.getStatus());
        accessDevice.setDeviceNumber(request.getDeviceNumber());

        return accessDevice;
    }

    /**
     * 编辑请求转换为domain
     * @author shd
     * @date 2021/7/6 13:46
     * @param request
     * @return com.jzy.oms.access.device.bean.domain.AccessDevice
     */
    public static AccessDevice transferAccessDevice(AccessDeviceEditRequest request) {

        AccessDevice accessDevice = new AccessDevice();
        accessDevice.setId(request.getId());
        accessDevice.setParkId(request.getParkId());
        accessDevice.setName(request.getName());
        accessDevice.setModel(request.getModel());
        accessDevice.setAddress(request.getAddress());
        accessDevice.setAccessType(request.getAccessType());
        accessDevice.setIsNetwork(request.getIsNetwork());
        accessDevice.setDevSn(request.getDevSn());
        accessDevice.setStatus(request.getStatus());
        accessDevice.setDeviceNumber(request.getDeviceNumber());

        return accessDevice;
    }
}
